<?php echo '<?php'; ?>

class <?php echo $this->className; ?> extends CWidget
{

public $assetPath;

protected function publishAssets()
{
if(($theme=Yii::app()->getTheme())!==null){
$className=str_replace('\\','_',ltrim(get_class($this),'\\')); // possibly namespaced class
$path=$theme->getViewPath().DIRECTORY_SEPARATOR.$className;
if (!is_dir($path)) $path = $this->getViewPath();
}else{
$path=$this->getViewPath();
}
return Yii::app()->assetManager->publish(
$path . DIRECTORY_SEPARATOR . 'assets',
false,
-1,
YII_DEBUG
);
}

public function run()
{
$this->assetPath=$this->publishAssets();
$cs = Yii::app()->clientScript;
$this->render('<?php echo $this->className; ?>Html',array('assetPath'=>$this->assetPath));
}
}